package cn.colins.consumer.filter;

import org.apache.dubbo.common.extension.Activate;
import org.apache.dubbo.rpc.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @program: dubbo-annotation-study
 * @description:
 * @author: colins
 * @create: 2023-05-07 21:39
 **/
@Activate(group = {"provider","consumer"})
public class MyDubboFilter implements Filter {

    private final static Logger log= LoggerFactory.getLogger(MyDubboFilter.class);

    @Override
    public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
        log.info("dubbo 方法执行前.....");

        Result result = invoker.invoke(invocation);


        log.info("dubbo 方法执行后.....");
        return result;
    }
}
